package com.leyou.auth.utils;

import com.leyou.auth.dto.UserDetails;

public class UserHolder {
    private static final ThreadLocal<UserDetails> tl= new ThreadLocal<>();

    public static void setUser(UserDetails user){
        tl.set(user);
    }

    public static UserDetails getUser(){
        return tl.get();
    }
    public static void remove(){
        tl.remove();
    }
}
